<{include file="../templates/front/header.html"}>
<script type="text/javascript" src="../js/jquery.js">
</script>
<script type="text/javascript" src="../templates/front/js/region.js">
</script>

<div class="blank"></div>

<div class="block clearfix">
	<{if $action neq 'address_update'}>
	<div id="userLeft" class="fl">
		<div class="mod1 mod2 blank" >
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<h1 class="mod2tit">用户中心</h1>
			<div class="cagegoryCon clearfix">
				<ul class="userMenu">
					<li><a href="user.php?act=manage" class="curs">欢迎</a></li>
					<li><a href="user.php?act=order_list"> 我的订单</a></li>
					<li><a href="user.php?act=address_list"> 收货地址</a></li>
					<li><a href="user.php?act=profile">账户信息</a></li>
				</ul>	
			</div>
		</div>
		<div class="blank"></div>
	</div>
	<{/if}>
	
	<!-- 欢迎start -->
	<{if $action eq 'index'}>
	<div id="userRight" class="fr">
		<div class="ur_here blank">当前位置: <a href="index.php">首页</a> <code>&gt;</code> 用户中心</div>  
		<div class="us_contentBox default clearfix mod1 mod2">
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<font class="price"><{$SESSION.username}></font>&nbsp;您上一次登录时间:&nbsp;<{$lastLogin}><br /><br />
		</div>	
	</div>
	<{/if}>
	<!-- 欢迎end -->
	
	<!-- 我的订单start -->
	<{if $action eq 'order_list'}>
	<div id="userRight" class="fr">
    	<div class="us_contentBox mod1 mod2">
		  	<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
		   	<h6>我的订单</h6>
			<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
				<tr align="center">
					<td bgcolor="#ffffff">订单号</td>
					<td bgcolor="#ffffff">下单时间</td>
					<td bgcolor="#ffffff">订单总金额</td>
					<td bgcolor="#ffffff">订单状态</td>
					<td bgcolor="#ffffff">操作</td>
				</tr>
				<{foreach from=$order_list item=order}>
				<tr>
					<td align="center" bgcolor="#ffffff"><a href="user.php?act=order_detail&order_id=<{$order.order_id}>"><{$order.order_sn}></a></td>
					<td align="center" bgcolor="#ffffff"><{$order.addtime}></td>
					<td align="right" bgcolor="#ffffff">￥&nbsp;<{$order.amount}>元</td>
					<td align="center" bgcolor="#ffffff"><{if $order.pay_status eq 1}>已付款<{elseif $order.pay_status eq 0}>未付款<{/if}></td>
					<td align="center" bgcolor="#ffffff"><font class="f6"><a href="user.php?act=delete_order&order_id=<{$order.order_id}>" onclick="if (!confirm('您确认要取消该订单吗？取消后此订单将视为无效订单')) return false;">删除订单</a></font></td>
				</tr>
				<{/foreach}>
			</table>
		</div>
		<div class="pagebar">
			<form name="selectPageForm" action="/ecshop/user.php" method="get">
				<div id="pager">
					 总计 <b><{$count}></b>  个记录      
				</div>
			</form>
		</div>
	</div>
	<{/if}>
	<!-- 我的订单end -->
	
	<!-- 收货地址start -->
	<{if $action eq 'address'}>
	<div id="userRight" class="fr">
		<div class="us_contentBox mod1 mod2">
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<h6>收货人信息</h6>
			
			<{foreach from=$address_list item=address}>
			<form action="user.php?act=address_update&address_id=<{$address.address_id}>" method="post" name="theForm" onsubmit="return checkConsignee(this)">
				<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
					<tr>
						<td bgcolor="#ffffff">配送区域:</td>
						<td>
						<{$address.country}>&nbsp;
						<{$address.province}>&nbsp;
						<{$address.city}>&nbsp;
						<{$address.district}>&nbsp;
						<{$address.address}>
						</td>
					</tr>
					<tr>
						<td bgcolor="#ffffff">收货人姓名:</td>
						<td bgcolor="#ffffff"><{$address.consignee}></td>
						<td bgcolor="#ffffff">电子邮件地址:</td>
						<td bgcolor="#ffffff"><{$address.email}></td>
					</tr> 
					<tr>
						<td bgcolor="#ffffff">详细地址:</td>
						<td bgcolor="#ffffff"><{$address.address}></td>
						<td bgcolor="#ffffff">邮政编码:</td>
						<td bgcolor="#ffffff"><{$address.zipcode}></td>
					</tr>
					<tr>
						<td bgcolor="#ffffff">电话:</td>
						<td bgcolor="#ffffff"><{$address.tel}></td>
						<td bgcolor="#ffffff">手机:</td>
						<td bgcolor="#ffffff"><{$address.mobile}></td>
					</tr>
					<tr>
					<td align="right" bgcolor="#ffffff">&nbsp;</td>
					<td colspan="3" align="center" bgcolor="#ffffff">											<input type="submit" name="submit" class="bnt_number4" value="确认修改" />
						<input name="button" type="button" class="bnt_number2"  onclick="if (confirm('你确认要删除该收货地址吗？'))location.href='user.php?act=drop_consignee&id=<{$address.address_id}>'" value="删除" />					<input type="hidden" name="act" value="act_edit_address" />
						<input name="address_id" type="hidden" value="<{$address.address_id}>" />
					</td>
					</tr>
				</table>
			</form>
			<{/foreach}>
			
			<form action="user.php?act=address_insert" method="post" name="theForm" onsubmit="return checkConsignee(this)">
				<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
					<tr>
						<td bgcolor="#ffffff">配送区域:</td>
						<td colspan="3" bgcolor="#ffffff">
						<select name="country" id="selCountries_1" onchange="region(this, 'selCountries_1')"  class="InputBorder">
							<option value="0" selected="selected">请选择国家</option>
							<option value="1">中国</option>
						</select>
						<select name="province" id="selProvinces_1" onchange="region(this, 'selProvinces_1')"  class="InputBorder">
							<option value="0" selected="selected">请选择省</option>
						</select>
						<select name="city" id="selCities_1" onchange="region(this, 'selCities_1')"  class="InputBorder">
							<option value="0" selected="selected">请选择市</option>
						</select>
						<!-- <select name="district" id="selDistricts_0" style="display:none"  class="InputBorder"> -->
						<select name="district" id="selDistricts_0"  class="InputBorder">
							<option value="0" selected="selected">请选择区</option>
						</select>(必填) 
						</td>
					</tr>
					<tr>
						<td bgcolor="#ffffff">收货人姓名:</td>
						<td bgcolor="#ffffff"><input name="consignee" type="text" class="InputBorder" id="consignee_1" value="" />
						(必填) </td>
						<td bgcolor="#ffffff">电子邮件地址:</td>
						<td bgcolor="#ffffff"><input name="email" type="text" class="InputBorder"  id="email_1" value="" />
						(必填)</td>
					</tr> 
					<tr>
						<td bgcolor="#ffffff">详细地址:</td>
						<td bgcolor="#ffffff"><input name="address" type="text" class="InputBorder"  id="address_1" value="" />
						(必填)</td>
						<td bgcolor="#ffffff">邮政编码:</td>
						<td bgcolor="#ffffff"><input name="zipcode" type="text" class="InputBorder"  id="zipcode_1" value="" /></td>
					</tr>
					<tr>
						<td bgcolor="#ffffff">电话:</td>
						<td bgcolor="#ffffff"><input name="tel" type="text" class="InputBorder"  id="tel_1" value="" />
						(或者电话必填一种)</td>
						<td bgcolor="#ffffff">手机:</td>
						<td bgcolor="#ffffff"><input name="mobile" type="text" class="InputBorder"  id="mobile_1" value="" />
						(或者手机必填一种)</td>
					</tr>
					<tr>
						<td align="right" bgcolor="#ffffff">&nbsp;</td>
						<td colspan="3" align="center" bgcolor="#ffffff">
							<input type="submit" name="submit" class="bnt_number6"  value="新增收货地址"/>
							<input type="hidden" name="act" value="act_edit_address" />
							<input name="address_id" type="hidden" value="" />
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<{/if}>
	<!-- 收货地址end -->
	
	<!-- 账户信息start -->
	<{if $action eq 'profile'}>
	<div id="userRight" class="fr">
		<div class="us_contentBox mod1 mod2">
	        <span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
	    	<h6>个人资料</h6>
    		<form name="formEdit" action="user.php?act=user_update&user_id=<{$user_info.user_id}>" method="post" >
   				<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
   					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">姓名： </td>
						<td width="72%" align="left" bgcolor="#FFFFFF">
						<input name="username4" type="text" value="<{if $user_info.username neq ''}><{$user_info.username}><{/if}>" size="25" class="InputBorder" /><span style="color:#FF0000"> *</span>
						</td>
					</tr>
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">出生日期： </td>
						<td width="72%" align="left" bgcolor="#FFFFFF">
							<select name="birthdayYear">
								<option value="1953">1953</option>
								<option value="2014">2014</option>
							</select>&nbsp;
							<select name="birthdayMonth">
								<option value="1">01</option>
								<option value="2">02</option>
							</select>&nbsp;
							<select name="birthdayDay">
								<option value="31">31</option>
							</select>
						</td>
					</tr>
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">性　别： </td>
						<td width="72%" align="left" bgcolor="#FFFFFF">
						  <input type="radio" name="sex" value="0" <{if $user_info.sex eq ''}> checked="checked" <{/if}> />
							保密&nbsp;&nbsp;
							<input type="radio" name="sex" value="1" <{if $user_info.sex eq '男'}> checked="checked" <{/if}> />
							男&nbsp;&nbsp;
							<input type="radio" name="sex" value="2" <{if $user_info.sex eq '女'}> checked="checked" <{/if}> />
						女&nbsp;&nbsp; </td>
					</tr>
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">邮箱地址： </td>
						<td width="72%" align="left" bgcolor="#FFFFFF">
						<input name="email" type="text" value="<{if $user_info.email neq ''}><{$user_info.email}><{/if}>" size="25" class="InputBorder" /><span style="color:#FF0000"> *</span>
						</td>
					</tr>
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">QQ： </td>
						<td width="72%" align="left" bgcolor="#FFFFFF">
						<input name="qq" type="text" value="<{if $user_info.qq neq 0}><{$user_info.qq}><{/if}>" size="25" class="InputBorder" /><span style="color:#FF0000"> *</span>
						</td>
					</tr>
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF" id="extend_field5i">手机：</td>
						<td width="72%" align="left" bgcolor="#FFFFFF">
						<input name="tel" type="text" class="InputBorder" value="<{if $user_info.tel neq 0}><{$user_info.tel}><{/if}>"/><span style="color:#FF0000"> *</span>					</td>
					</tr>
					<tr>
						<td colspan="2" align="center" bgcolor="#FFFFFF"><input name="act" type="hidden" value="act_edit_profile" />
							<input name="submit" type="submit" value="确认修改" class="bnt_number4" />
						</td>
					</tr>
       			</table>
    		</form>
			<form name="formPassword" action="user.php?act=password_update" method="post" >
				<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">原密码：</td>
						<td width="76%" align="left" bgcolor="#FFFFFF"><input name="ol_password" type="password" size="25"  class="InputBorder" /></td>
					</tr>
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">新密码：</td>
						<td align="left" bgcolor="#FFFFFF"><input name="new_password" type="password" size="25"  class="InputBorder" /></td>
					</tr>
					<tr>
						<td width="28%" align="right" bgcolor="#FFFFFF">确认密码：</td>
						<td align="left" bgcolor="#FFFFFF"><input name="comfirm_password" type="password" size="25"  class="InputBorder" /></td>
					</tr>
					<tr>
						<td colspan="2" align="center" bgcolor="#FFFFFF">
							<input name="act" type="hidden" value="act_edit_password" />
							<input name="submit" type="submit" class="bnt_number4" value="确认修改" />
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<{/if}>
	<!-- 账户信息end -->
	
	<{if $action eq 'order_detail'}>
	<div id="userRight" class="fr">
    	<div class="us_contentBox mod1 mod2">
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<h6>订单状态</h6>
			<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
				<tr>
					<td width="15%" align="right" bgcolor="#ffffff">订单号：</td>
					<td align="left" bgcolor="#ffffff"><{$order_info.order_sn}></td>
				</tr>
			</table>
		</div>
		<div class="us_contentBox mod1 mod2">
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<h6 class="clearfix"><span class="fl">商品列表</span>
				<span class="fr">
				<a href="javascript:;" onclick="returnToCart(24)" class="us_textDot">放回购物车</a>
				</span>
			</h6>
			<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
				<tr>
					<th width="23%" align="center" bgcolor="#ffffff">商品名称</th>
					<th width="26%" align="center" bgcolor="#ffffff">商品价格</th>
					<th width="9%" align="center" bgcolor="#ffffff">购买数量</th>
					<th width="20%" align="center" bgcolor="#ffffff">小计</th>
				</tr>
				<{foreach from=$goods_list item=good}>
				<tr>
					<td bgcolor="#ffffff"><a href="goods.php?goods_id=<{$good.goods_id}>" target="_blank"><{$good.goods_name}></a></td>
					<td align="right" bgcolor="#ffffff" class="price">￥&nbsp;<{$good.shop_price}>元</td>
					<td align="center" bgcolor="#ffffff" class="price"><{$good.num}></td>
					<td align="right" bgcolor="#ffffff" class="price">￥&nbsp;<{$good.subtotal}>元</td>
				</tr>
				<{/foreach}>
				<tr>
					<td colspan="8" bgcolor="#ffffff" align="right">
					商品总价:<font class="price">￥&nbsp;<{$subtotal}>元</font>
					</td>
				</tr>
			</table>
		</div>	
		<div class="us_contentBox mod1 mod2">
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<h6>费用总计</h6>
			<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
				<tr>
					<td align="right" bgcolor="#ffffff">
					 商品总价: <font class="f1 f14b">￥&nbsp;<{$good.subtotal}>元</font>
					 + 配送费用: <font class="f1 f14b">￥&nbsp;10.00元</font>
					</td>
				</tr>
				<tr>
					<td align="right" bgcolor="#ffffff">
					</tr>
					<tr>
					<td align="right" bgcolor="#ffffff">应付款金额: <font class="f1 f14b">￥&nbsp;<{$order_info.amount}>元</font>
					</td>
				</tr>
			</table>
		</div>
		<div class="us_contentBox mod1 mod2">
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<h6>收货人信息</h6>
			<form action="user.php" method="post" name="formAddress" id="formAddress">
				<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
					<tr>
						<td width="15%" align="right" bgcolor="#ffffff">收货人姓名： </td>
						<td width="35%" align="left" bgcolor="#ffffff"><{$order_info.consignee}></td>
						<td width="15%" align="right" bgcolor="#ffffff">电子邮件地址： </td>
						<td width="35%" align="left" bgcolor="#ffffff"><{$order_info.email}></td>
					</tr>
					<tr>
						<td align="right" bgcolor="#ffffff">详细地址： </td>
						<td align="left" bgcolor="#ffffff"><{$region}></td>
						<td align="right" bgcolor="#ffffff">邮政编码：</td>
						<td align="left" bgcolor="#ffffff"><{$order_info.zipcode}></tr>
					<tr>
						<td align="right" bgcolor="#ffffff">电话：</td>
						<td align="left" bgcolor="#ffffff"><{$order_info.tel}></td>
						<td align="right" bgcolor="#ffffff">手机：</td>
						<td align="left" bgcolor="#ffffff"><{$order_info.mobile}></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<{/if}>
	
	<!-- 修改地址 start -->
	<{if $action eq 'address_update'}>
	<div class="blank"></div>
	<div class="ur_here blank">当前位置: <a href=".">首页</a> <code>&gt;</code> 修改地址</div>
	<div class="block">
		<div class="blank"></div>
		<form action="user.php?act=address_update_ok&address_id=<{$address.address_id}>" method="post" name="theForm" id="theForm" >
			<div class="goodsTitle">收货人信息</div>
			<table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#e3e3e3" class="floatTable">  
				<tr>
					<td bgcolor="#ffffff">配送区域:</td>
					<td colspan="3" bgcolor="#ffffff">
					<select name="country" id="selCountries_3" onchange="region(this, 'selCountries_3');"  class="InputBorder">
						<option value="0" selected="selected">请选择国家</option>
						<option value="1">中国</option>
					</select>
					<select name="province" id="selProvinces_3" onchange="region(this, 'selProvinces_3')"  class="InputBorder">
						<option value="0" selected="selected">请选择省</option>
					</select>
					<select name="city" id="selCities_3" onchange="region(this, 'selCities_3')"  class="InputBorder">
						<option value="0" selected="selected">请选择市</option>
					</select>
					<select name="district" id="selDistricts_3"  class="InputBorder">
						<option value="0" selected="selected">请选择区</option>
					</select>(必填) 
					</td>
				</tr>
				<!-- 
				<input id="selCountries_2" type="hidden" value="<{$address.country}>" />
				<input id="selProvinces_2" type="hidden" value="<{$address.province}>" />
				<input id="selCities_2" type="hidden" value="<{$address.city}>" />
				<input id="selDistricts_2" type="hidden" value="<{$address.district}>" />
				 -->
				<tr>
					<td bgcolor="#ffffff">收货人姓名:</td>
					<td bgcolor="#ffffff"><input name="consignee" type="text" class="InputBorder" id="consignee_0" value="<{$address.consignee}>" />
					(必填) </td>
					<td bgcolor="#ffffff">电子邮件地址:</td>
					<td bgcolor="#ffffff"><input name="email" type="text" class="InputBorder"  id="email_0" value="<{$address.email}>" />
					(必填)</td>
				</tr>
				<tr>
					<td bgcolor="#ffffff">详细地址:</td>
					<td bgcolor="#ffffff"><input name="address" type="text" class="InputBorder"  id="address_0" value="<{$address.address}>" />
					(必填)</td>
					<td bgcolor="#ffffff">邮政编码:</td>
					<td bgcolor="#ffffff"><input name="zipcode" type="text" class="InputBorder"  id="zipcode_0" value="<{$address.zipcode}>" /></td>
				</tr>
				<tr>
					<td bgcolor="#ffffff">电话:</td>
					<td bgcolor="#ffffff"><input name="tel" type="text" class="InputBorder"  id="tel_0" value="<{$address.tel}>" />
					(必填)</td>
					<td bgcolor="#ffffff">手机:</td>
					<td bgcolor="#ffffff"><input name="mobile" type="text" class="InputBorder"  id="mobile_0" value="<{$address.mobile}>" /></td>
				</tr>
				<tr>
					<td colspan="4" align="center" bgcolor="#ffffff">
					<input type="submit" name="Submit" class="bnt_number8" value="配送至这个地址" />       
					<input name="button" type="button" onclick="if (confirm('您确定要删除该收货人信息吗？')) location.href='flow.php?step=drop_consignee&address_id=<{$address.address_id}>'"  class="bnt_number2" value="删除" />
					<!-- <input type="hidden" name="step" value="consignee" />
					<input type="hidden" name="act" value="checkout" />
					<input name="address_id" type="hidden" value="5" /> -->
					</td>
				</tr>
			</table>
		</form>
	</div>
	<{/if}>
	<!-- 修改地址 end -->
	
	
</div>

<{include file="../templates/front/footer.html"}>